<?php
namespace app\common\model;

use app\common\BaseModel;

class System extends BaseModel
{
    protected $name = 'system';

    /**
     * 获取配置值
     * @param $item
     * @return mixed
     */
    public static function getItem($item)
    {
        return static::where('conf_item', $item)->cache(10)->value('conf_value');
    }
	
	/**
	 * 获取指定类型的所有配置项目
	 * @param integer $type 项目类型
	 */
	public static function getItemByType($type = 1)
	{
        return static::where('conf_type', $type)->cache(10)->column('conf_value','conf_item', true);
	}
}
